package com.wzapp.sitposture.setup.entity;

import com.alibaba.fastjson.JSONObject;
import com.wzapp.sitposture.common.converter.DateConverterJson;
import com.wzapp.sitposture.common.converter.JsonObjectConverterJson;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;

/**
 * Created by qianglong on 2018/1/15.
 */
@Data
@Entity(name = "config_setup")
public class Setup implements Serializable{

    private static final long serialVersionUID = -4938216217230876920L;

    @Id
    @GeneratedValue(generator = "uuid_32")
    @GenericGenerator(name = "uuid_32", strategy = "uuid")
    @Column(length = 32)
    private String id;
    /**
     * 分组类型
     */
    private String groupType;
    /**
     * 分组名称
     */
    private String groupName;

    @Convert(converter = JsonObjectConverterJson.class)
    @Column(length = 1000)
    private JSONObject data;

    /**
     * 版本
     */
    private String version;
    /**
     * 排序
     */
    private Integer sortNum;
    /**
     * 状态：valid 有效； invalid 无效
     */
    private String status;

    /**
     * 创建时间
     */
    @Column(updatable = false)
    @Convert(converter = DateConverterJson.class)
    private Long createTime;
}
